﻿using WebServices.Requests;
using FlightTicketModel;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace WebServices.Models
{
    public class FlightTicketTaskRequest : IRequestPage
    {
        /// <summary>
        /// 外网IP
        /// </summary>
        public string IP { get; set; }
        /// <summary>
        /// 航司ID
        /// </summary>
        public int AirlineID { get; set; }
        /// <summary>
        /// 出发地
        /// </summary>
        public string AirCode1 { get; set; } = "";
        /// <summary>
        /// 中转
        /// </summary>
        public string AirCode2 { get; set; } = "";
        /// <summary>
        /// 到达
        /// </summary>
        public string AirCode3 { get; set; } = "";
        /// <summary>
        /// 开始时间/出发时间
        /// </summary>
        public string date1 { get; set; }
        /// <summary>
        /// 结束时间/出发时间"2018-08-02"
        /// </summary>
        public string date2 { get; set; }
        /// <summary>
        /// 任务状态
        /// </summary>
        public TaskStatus Status { get; set; }
        public DateTime? date11
        {
            get
            {
                DateTime dt = DateTime.Now;
                if (DateTime.TryParse(date1, out dt))
                { return dt; }
                else return null;
            }
        }
        public DateTime? date22
        {
            get
            {
                DateTime dt = DateTime.Now;
                if (DateTime.TryParse(date2, out dt))
                { return dt; }
                else return null;
            }
        }
        /// <summary>
        /// 航程:单程/往返
        /// </summary>
        public AirLineType AirLineType { get; set; } = AirLineType.OneWay;

        /// <summary>
        /// 第几页
        /// </summary>
        public int PageIndex { get; set; }
        /// <summary>
        /// 每页多少条
        /// </summary>
        public int PageSize { get; set; }
    }
}